#coding=utf-8
import orm

MEETING_DB='test_db'


@orm.build_model
class Users(orm.Model):
    _table = 'new_users'
    _conn_name = MEETING_DB
    _name = '用户表'
    id = orm.IntegerType(name="id",length=12,auto_increase=True,primary_key=True,comment="主键",unsigned=True)
    name = orm.CharType(name="name",length=100,varchar=True,comment="昵称")
    openid = orm.CharType(name="openid",length=255,varchar=True,comment="开放id")
    status = orm.IntegerType(name="status",length=2,unsigned=True,comment="用户状态",blank=0)
    level = orm.IntegerType(name="level",length=2,unsigned=True,comment="用户级别",blank=0)
    created_at = orm.DatetimeType(name='created_at', comment='创建时间', auto='on_create')
    updated_at = orm.DatetimeType(name='updated_at', comment='更新时间', auto='on_update')
    key_openid_index = orm.Key(key_name="key_openid_index",col_name="openid")


#Users.create_table()


